<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
    <head th:replace="lib :: common_header"></head>
    <body>
        <div th:replace="lib :: header_box"></div>
        <div th:replace="lib :: menu_box (32)"></div>

        <div class="main-box">
            <div class="main-container">
                <div th:replace="lib :: main_container_header ('查看我的申请', '查看我的申请')"></div><!-- /main_container_header -->
                <div class="f14" id="app" v-cloak>
                    <el-card shadow="hover" style="display:none;">
                        <el-form ref="form" label-width="100px" :inline="true">
                            <el-form-item label="创建时间：" style="margin-bottom:0;">
                                <el-date-picker
                                        type="daterange"
                                        range-separator="-"
                                        start-placeholder="开始日期"
                                        end-placeholder="结束日期">
                                </el-date-picker>
                            </el-form-item>
                            <el-form-item style="margin-bottom:0;">
                                <el-button type="primary">查 询</el-button>
                            </el-form-item>
                        </el-form>
                    </el-card>
                    <br>

                    <el-card shadow="hover">
                        <el-table :data="projects"
                                  :show-header="false"
                                  :default-expand-all="true"
                                  style="width: 100%">
                            <el-table-column type="expand">
                                <template slot-scope="scope">
                                    <div class="rel f12" style="padding-left:20px; border:0;" v-for="(item, index) in scope.row.haha">
                                        <p class="b">
                                            <i class="el-icon-coin"></i> {{ item.asset_name }}
                                            &nbsp; [{{ item.asset_file_name }}]
                                        </p>
                                        <p>
                                            <template v-if="item.asset_type == 'O' || item.asset_type == 'R' || item.asset_type == 'L' || item.asset_type == 'P'">
                                                <template v-if="item.ping_result =='P'">
                                                    &nbsp;&nbsp;&nbsp;&nbsp;
                                                    平台审批结果：<el-tag type="success" size="mini">{{ item.ping_result | cvApprovalResult }}</el-tag>
                                                    <el-divider direction="vertical"></el-divider>
                                                    审批时间：{{ item.ping_date }}
                                                </template>
                                                <template v-else>
                                                    &nbsp;&nbsp;&nbsp;&nbsp;
                                                    平台审批结果：<el-tag type="mini">待审批</el-tag>
                                                </template>
                                            </template>
                                        </p>
                                        <p>
                                            <template v-if="item.asset_type == 'L' || item.asset_type == 'P'">
                                                <template v-if="item.haha_result">
                                                    &nbsp;&nbsp;&nbsp;&nbsp;
                                                    会员审批结果：<el-tag type="success" size="mini">{{ item.haha_result | cvApprovalResult }}</el-tag>
                                                    <el-divider direction="vertical"></el-divider>
                                                    审批时间：{{ item.haha_date }}
                                                </template>
                                                <template v-else>
                                                    &nbsp;&nbsp;&nbsp;&nbsp;
                                                    会员审批结果：<el-tag type="mini">待审批</el-tag>
                                                </template>
                                            </template>
                                        </p>

                                        <div class="abs tr" style="width:200px; height:30px; top:50%; margin-top:-15px; right:20px;">
                                            <el-button type="mini" v-if="!item.ping_result" @click="cancelApply(item.id)">取消申请</el-button>
                                            &nbsp;
                                            <el-popover
                                                    placement="left"
                                                    title="审批意见"
                                                    width="300"
                                                    trigger="click">
                                                <table width="100%" v-if="item.ping_result">
                                                    <tr v-if="item.cv_approval_result">
                                                        <td class="pb10">会员审批意见：</td>
                                                        <td class="pb10">{{ item.haha_comment }}</td>
                                                    </tr>
                                                    <template v-if="item.cv_approval_result">
                                                        <tr>
                                                            <td valign="top" width="100">平台审批意见：</td>
                                                            <td>{{ item.ping_result | cvApprovalResult2 }}</td>
                                                        </tr>
                                                    </template>
                                                    <template v-else>
                                                        <tr>
                                                            <td valign="top" width="100">平台审批意见：</td>
                                                            <td>{{ item.ping_result | cvApprovalResult }}</td>
                                                        </tr>
                                                    </template>
                                                </table>
                                                <div v-if="!item.ping_result">
                                                    审批中，请等待
                                                </div>
                                                <el-button type="mini" slot="reference">查看审批意见</el-button>
                                            </el-popover>
                                        </div>

                                    </div>
                                </template>
                            </el-table-column>
                            <el-table-column>
                                <template scope="scope">
                                    申请项目：<span class="red b">{{ scope.row.project_name }}</span>
                                </template>
                            </el-table-column>
                            <el-table-column width="240px;">
                                <template scope="scope">
                                    申请时间：{{ scope.row.ti_date }}
                                </template>
                            </el-table-column>
                        </el-table>
                    </el-card>


                </div><!-- /app -->
            </div>
        </div>
        <div th:replace="lib :: javascript_box"></div>
        <script th:src="@{/lib/user/datasource_approval.js}"></script>
    </body>
</html>

